package com.weichat.controller;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.model.User;
import com.service.UserService;
import com.weichat.tool.WeiChatUtil;

@Controller
public class FindUserController {

	@Autowired
	UserService ud;
	@RequestMapping("findUser")
	public String findUser(HttpServletRequest req){
		
		String openId=(String) req.getSession().getAttribute("openId");
		//req.getSession().setAttribute("openId", openId);
		System.out.println(" ---openId=="+openId);
		
		
		if(ud.selectByOpenId(openId).size()==0){
			return "/register.html";
		}else{
			//return (String)req.getSession().getAttribute("url");
			return "/Jump";
		}
		//查看openid是否对应有用户没有就跳转到注册页面有就继续执行用户的操作
		//
		
	}
	
	
	
	
}
